class BootStrap {

    def init = { servletContext ->
        def adminRole = new duylinh.Role(authority: 'ROLE_ADMIN').save(flush: true)
        def userRole = new duylinh.Role(authority: 'ROLE_USER').save(flush: true)

        def testUser
        try
        {
            println("hello")
            testUser = new duylinh.User( username: 'me'
                    , enabled: true
                    , password: 'password'
                    , ten: 'Nguyen Trong Duy'
                    , mobile: '0973511031'
                    , accountExpired:false
                    , accountLocked:false
                    , passwordExpired:false
            )
            testUser.save(flush: true)

            println ( "blabla : " + duylinh.User.count() )
        }catch (e)
        {
            println(e)
        }

    }


    def destroy = {
    }
}
